-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Imporve the indexing function for the pages screenshot. #1840
base: master
Are you sure you want to change the base?
Conversation
…_get_screenshot_path /* def _get_screenshot_path(self, filename): if self._screenshot_root_directory != EMBED: directory = self._screenshot_root_directory or self.log_dir else: directory = self.log_dir filename = filename.replace("/", os.sep) YY_MM_DD_HH_MM_SS = datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S') while True: YY_MM_DD_HH_MM_SS = datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S') formatted = _format_path(filename, YY_MM_DD_HH_MM_SS) path = os.path.join(directory, formatted) # filename didn't contain {YY_MM_DD_HH_MM_SS} or unique path was found if formatted == filename or not os.path.exists(path): return path */ This action is inprogress
Selenium-Screenshot-{index} index : 'YYYY-MM-DD-HH-MM-SS-RANDOM
@AmirHdm Just wanted to let you know that your pull request has been noticed and within the queue to be reviewed. My plan was to bring this to the team to review and discuss. I will update you sometime within the next couple weeks. |
@AmirHdm Is this changing the naming of screenshot files from simply numbering them sequentially based on the index, to using the timestamp in the name? That does seem like a good idea, if so. |
@lisacrispin yeath that's right because using timestamps in naming is more helpful and significantly |
@AmirHdm I like the idea of providing different type of "indexing" or filenames. One concern I do have though is breaking any existing systems that rely on numerical indexing. Relooking at the code and keyword documentation I see for singular Capture Page Screenshot there is a filename argument which allows one to format the filename. I'm curious as to whether we could use this "syntactical idea" to allow for something like |
@emanlove sure i guess we could apply your idea and actually it's a great feature then let me see what i could do and will give a quick feedback |
…ature Add formatting functions for a randon & timestamp placeholders
… {random} or {timestamp}.png' Add three indexing option : index / random / timestamp
The user now is able to set 3 indexing options on the keyword capture page screenshot :
|
# filename didn't contain {index} or unique path was found | ||
if formatted == filename or not os.path.exists(path): | ||
return path | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick read of this I believe there is a logic error here where if none of the three are in the filename one will get themselves into an infinite loop.
Add indexing functionality based on datetime for capture screen page method inside ScreenshotKeywords class.